﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyInvoice.Services
{
    public class UsersService
    {
        EasyInvoice.SqlCEDAL.IUsers dal;

        public UsersService(EasyInvoice.SqlCEDAL.IUsers dal)
        {
            if (dal == null)
            {
                throw new ArgumentNullException("dal");
            }
            this.dal = dal;
        }

        public long Save(Model.User user)
        {
            return dal.Save(user);
        }

        public Model.User Delete(Model.User user)
        {
            return dal.Delete(user);
        }

        public Model.User Get(long id)
        {
            return dal.GetById(id);
        }

        public IEnumerable<Model.User> GetAll()
        {
            return dal.GetAll();
        }
    }
}
